package com.ibeetl.admin.aod.service.excel.parser;

import com.ibeetl.admin.aod.util.DateUtils;
import com.ibeetl.admin.aod.web.dto.AodIndustryDataDto;
import com.ibeetl.admin.aod.web.dto.AodIndustryReplyDataDto;
import com.ibeetl.admin.core.util.DateUtil;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Component;

@Component
public class ReplyFileParser extends AbstractFileParser {

    @Override
    public AodIndustryReplyDataDto parseReply(String line) {
        String[] lines = line.split(",");
        AodIndustryReplyDataDto aodIndustryReplyDataDto = new AodIndustryReplyDataDto();
        aodIndustryReplyDataDto.setPhoneNumber(lines[2]);
        aodIndustryReplyDataDto.setReplyContent(lines[4]);
        aodIndustryReplyDataDto.setReplyTime(DateUtils.parse(lines[0], "yyyyMMddHHmmss"));
        return aodIndustryReplyDataDto;
    }
}
